//
//  WriteViewController.swift
//  约健
//
//  Created by tyh on 2017/10/18.
//  Copyright © 2017年 tyh. All rights reserved.
//

import UIKit

class WriteViewController: UIViewController,UITextViewDelegate {
    @IBOutlet weak var Text: UITextView!

    @IBOutlet weak var AddPic: UIButton!
    
    var turebarbtnItem:UIBarButtonItem!
    var rightBtn:UIButton = UIButton.init()
    override func viewDidLoad() {
        super.viewDidLoad()
        rightBtn.sizeToFit()
        rightBtn.addTarget(self, action: #selector(TiJiao), for: UIControlEvents.touchUpInside)
        turebarbtnItem = UIBarButtonItem.init(customView: rightBtn)
        self.navigationItem.rightBarButtonItem = turebarbtnItem
        self.rightBtn.setImage(UIImage.init(named: "上传.png"), for: .normal)
        
        Text.delegate = self
        Text.text = "说点什么吧..."

        // Do any additional setup after loading the view.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    func textViewDidBeginEditing(_ textView: UITextView) {
        if Text.text == "说点什么吧..."{
            Text.text = ""
        }
    }
    func textViewDidEndEditing(_ textView: UITextView) {
        if Text.text == ""{
           Text.text = "说点什么吧..."
        }
        
    }
    func TiJiao(){
        
    }

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
